/*
 * User.cpp
 *
 *  Created on: 26/06/2014
 *      Author: Vitor
 */

#include "User.h"

User::User(std::string username, std::string password) :
		username(username), password(password) {
}

User::~User() {
}

ByteQueue User::serialize_impl() {
	ByteQueue serialized;

	serialized.push<std::string>(username).push<std::string>(password);

	return serialized;
}

User User::deserialize_impl(ByteQueue& bytes) {
	std::string username = bytes.pop<std::string>();
	std::string password = bytes.pop<std::string>();

	return User(username, password);
}

std::string User::get_name() {
	return username;
}

std::string User::get_password() {
	return password;
}
